import type { IRoute } from 'umi';

export const menuRouter: IRoute[] = [
  {
    exact: true,
    path: '/home',
    title: '首页',
    component: '@/pages/home',
  },
  {
    exact: true,
    path: '/pandect',
    title: '啦啦啦德玛西亚',
    component: '@/pages/pandect',
  },
  {
    exact: true,
    path: '/echarts',
    title: '图标说明',
    component: '@/pages/echarts',
  },
  {
    title: '删除管理',
    path: '/del',
    routes: [
      {
        // exact: true,
        path: '/del/del1',
        title: '删除管理1',
        component: '@/pages/del/del1',
      },
      {
        // exact: true,
        path: '/del/del2',
        title: '删除管理2',
        // component: '@/pages/del/del2',
        routes: [
          {
            // exact: true,
            path: '/del/del2/del22',
            title: '删除管理22',
            component: '@/pages/del/del1',
          },
        ],
      },
    ],
  },
];

const routes: IRoute[] = [
  {
    path: '/register',
    title: '注册页面',
    component: '@/pages/login/register',
  },
  {
    path: '/login',
    title: '登录注册',
    component: '@/pages/login',
  },
  {
    path: '/',
    component: '@/layouts',
    routes: menuRouter,
  },
  // 404页面
  {
    title: '玩蛋呢？走丢了不知道啊',
    component: '@/pages/404',
  },
];

export default routes;
